<template>
  <div class="container">
    <!-- 页头 -->
    <header class="header">
      <h4 ><a href="http://localhost:9090/">首页</a>>买号</h4>
    </header>

    <div class="content">
      <!-- 字母导航栏 -->
      <div ref="letterNav" class="letter-nav">
        <!-- 循环生成字母导航链接 -->
        <a v-for="letter in letters.slice(1)" :key="letter" @click="scrollToCategory(letter)">
          {{ letter }}
        </a>
      </div>
      <!-- 顶部图片链接 -->
      <div class="top-images">
        <a v-for="(image, index) in topImages" :key="index" :href="image.link" target="_blank">
          <img :src="image.src" :alt="image.alt" />
        </a>
      </div>
      <!-- 游戏分类列表 -->
      <div class="game-list">
        <div v-for="(games, letter) in categorizedGames" :key="letter" :id="letter" class="game-category">
          <!-- 分类字母标题 -->
          <div class="letter">{{ letter }}</div>
          <!-- 游戏列表 -->
          <div class="games">
            <div v-for="game in games" :key="game.name" class="game">
              <a :href="game.link" target="_blank">
                <img :src="game.image" :alt="game.name">
              </a>
              <p>{{ game.name }}</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // 字母导航数组，包含"热门游戏"和字母A-Z
      letters: ['热门游戏', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
      // 游戏数据数组，每个游戏包含名称、图片、分类和链接
      games: [
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'A', link: '/buy/gameType/?game=11' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'A', link: '/buy/gameType/?game=12' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'A', link: '/buy/gameType/?game=13' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'A', link: '/buy/gameType/?game=14' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'A', link: '/buy/gameType/?game=15' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'A', link: '/buy/gameType/?game=16' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'A', link: '/buy/gameType/?game=17' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'A', link: '/buy/gameType/?game=18' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'A', link: '/buy/gameType/?game=19' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'B', link: '/buy/gameType/?game=21' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'B', link: '/buy/gameType/?game=22' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'B', link: '/buy/gameType/?game=23' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'B', link: '/buy/gameType/?game=24' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'B', link: '/buy/gameType/?game=25' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'B', link: '/buy/gameType/?game=26' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'B', link: '/buy/gameType/?game=27' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'B', link: '/buy/gameType/?game=28' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'B', link: '/buy/gameType/?game=29' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'C', link: '/buy/gameType/?game=31' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'C', link: '/buy/gameType/?game=32' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'C', link: '/buy/gameType/?game=33' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'C', link: '/buy/gameType/?game=34' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'C', link: '/buy/gameType/?game=35' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'C', link: '/buy/gameType/?game=36' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'C', link: '/buy/gameType/?game=37' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'C', link: '/buy/gameType/?game=38' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'C', link: '/buy/gameType/?game=39' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'D', link: '/buy/gameType/?game=41' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'D', link: '/buy/gameType/?game=42' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'D', link: '/buy/gameType/?game=43' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'D', link: '/buy/gameType/?game=44' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'D', link: '/buy/gameType/?game=45' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'D', link: '/buy/gameType/?game=46' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'D', link: '/buy/gameType/?game=47' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'D', link: '/buy/gameType/?game=48' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'D', link: '/buy/gameType/?game=49' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'E', link: '/buy/gameType/?game=51' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'E', link: '/buy/gameType/?game=52' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'E', link: '/buy/gameType/?game=53' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'E', link: '/buy/gameType/?game=54' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'E', link: '/buy/gameType/?game=55' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'E', link: '/buy/gameType/?game=56' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'E', link: '/buy/gameType/?game=57' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'E', link: '/buy/gameType/?game=58' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'E', link: '/buy/gameType/?game=59' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'F', link: '/buy/gameType/?game=61' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'F', link: '/buy/gameType/?game=62' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'F', link: '/buy/gameType/?game=63' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'F', link: '/buy/gameType/?game=64' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'F', link: '/buy/gameType/?game=65' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'F', link: '/buy/gameType/?game=66' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'F', link: '/buy/gameType/?game=67' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'F', link: '/buy/gameType/?game=68' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'F', link: '/buy/gameType/?game=69' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'G', link: '/buy/gameType/?game=71' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'G', link: '/buy/gameType/?game=72' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'G', link: '/buy/gameType/?game=73' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'G', link: '/buy/gameType/?game=74' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'G', link: '/buy/gameType/?game=75' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'G', link: '/buy/gameType/?game=76' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'G', link: '/buy/gameType/?game=77' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'G', link: '/buy/gameType/?game=78' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'G', link: '/buy/gameType/?game=79' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=81' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=82' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=83' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=84' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=85' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=86' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=87' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=88' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=89' },{ name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=81' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=82' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=83' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=84' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=85' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=86' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=87' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=88' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'H', link: '/buy/gameType/?game=89' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'I', link: '/buy/gameType/?game=91' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'I', link: '/buy/gameType/?game=92' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'I', link: '/buy/gameType/?game=93' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'I', link: '/buy/gameType/?game=94' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'I', link: '/buy/gameType/?game=95' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'I', link: '/buy/gameType/?game=96' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'I', link: '/buy/gameType/?game=97' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'I', link: '/buy/gameType/?game=98' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'I', link: '/buy/gameType/?game=99' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'J', link: '/buy/gameType/?game=101' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'J', link: '/buy/gameType/?game=102' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'J', link: '/buy/gameType/?game=103' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'J', link: '/buy/gameType/?game=104' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'J', link: '/buy/gameType/?game=105' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'J', link: '/buy/gameType/?game=106' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'J', link: '/buy/gameType/?game=107' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'J', link: '/buy/gameType/?game=108' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'J', link: '/buy/gameType/?game=109' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'K', link: '/buy/gameType/?game=111' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'K', link: '/buy/gameType/?game=112' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'K', link: '/buy/gameType/?game=113' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'K', link: '/buy/gameType/?game=114' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'K', link: '/buy/gameType/?game=115' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'K', link: '/buy/gameType/?game=116' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'K', link: '/buy/gameType/?game=117' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'K', link: '/buy/gameType/?game=118' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'K', link: '/buy/gameType/?game=119' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'L', link: '/buy/gameType/?game=121' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'L', link: '/buy/gameType/?game=122' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'L', link: '/buy/gameType/?game=123' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'L', link: '/buy/gameType/?game=124' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'L', link: '/buy/gameType/?game=125' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'L', link: '/buy/gameType/?game=126' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'L', link: '/buy/gameType/?game=127' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'L', link: '/buy/gameType/?game=128' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'L', link: '/buy/gameType/?game=129' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'M', link: '/buy/gameType/?game=131' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'M', link: '/buy/gameType/?game=132' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'M', link: '/buy/gameType/?game=133' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'M', link: '/buy/gameType/?game=134' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'M', link: '/buy/gameType/?game=135' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'M', link: '/buy/gameType/?game=136' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'M', link: '/buy/gameType/?game=137' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'M', link: '/buy/gameType/?game=138' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'M', link: '/buy/gameType/?game=139' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'N', link: '/buy/gameType/?game=141' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'N', link: '/buy/gameType/?game=142' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'N', link: '/buy/gameType/?game=143' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'N', link: '/buy/gameType/?game=144' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'N', link: '/buy/gameType/?game=145' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'N', link: '/buy/gameType/?game=146' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'N', link: '/buy/gameType/?game=147' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'N', link: '/buy/gameType/?game=148' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'N', link: '/buy/gameType/?game=149' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'O', link: '/buy/gameType/?game=151' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'O', link: '/buy/gameType/?game=152' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'O', link: '/buy/gameType/?game=153' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'O', link: '/buy/gameType/?game=154' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'O', link: '/buy/gameType/?game=155' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'O', link: '/buy/gameType/?game=156' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'O', link: '/buy/gameType/?game=157' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'O', link: '/buy/gameType/?game=158' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'O', link: '/buy/gameType/?game=159' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'P', link: '/buy/gameType/?game=161' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'P', link: '/buy/gameType/?game=162' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'P', link: '/buy/gameType/?game=163' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'P', link: '/buy/gameType/?game=164' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'P', link: '/buy/gameType/?game=165' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'P', link: '/buy/gameType/?game=166' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'P', link: '/buy/gameType/?game=167' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'P', link: '/buy/gameType/?game=168' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'P', link: '/buy/gameType/?game=169' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Q', link: '/buy/gameType/?game=171' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Q', link: '/buy/gameType/?game=172' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Q', link: '/buy/gameType/?game=173' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Q', link: '/buy/gameType/?game=174' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Q', link: '/buy/gameType/?game=175' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Q', link: '/buy/gameType/?game=176' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Q', link: '/buy/gameType/?game=177' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Q', link: '/buy/gameType/?game=178' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Q', link: '/buy/gameType/?game=179' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'R', link: '/buy/gameType/?game=181' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'R', link: '/buy/gameType/?game=182' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'R', link: '/buy/gameType/?game=183' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'R', link: '/buy/gameType/?game=184' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'R', link: '/buy/gameType/?game=185' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'R', link: '/buy/gameType/?game=186' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'R', link: '/buy/gameType/?game=187' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'R', link: '/buy/gameType/?game=188' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'R', link: '/buy/gameType/?game=189' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'S', link: '/buy/gameType/?game=191' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'S', link: '/buy/gameType/?game=192' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'S', link: '/buy/gameType/?game=193' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'S', link: '/buy/gameType/?game=194' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'S', link: '/buy/gameType/?game=195' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'S', link: '/buy/gameType/?game=196' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'S', link: '/buy/gameType/?game=197' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'S', link: '/buy/gameType/?game=198' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'S', link: '/buy/gameType/?game=199' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'T', link: '/buy/gameType/?game=201' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'T', link: '/buy/gameType/?game=202' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'T', link: '/buy/gameType/?game=203' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'T', link: '/buy/gameType/?game=204' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'T', link: '/buy/gameType/?game=205' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'T', link: '/buy/gameType/?game=206' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'T', link: '/buy/gameType/?game=207' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'T', link: '/buy/gameType/?game=208' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'T', link: '/buy/gameType/?game=209' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'U', link: '/buy/gameType/?game=211' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'U', link: '/buy/gameType/?game=212' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'U', link: '/buy/gameType/?game=213' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'U', link: '/buy/gameType/?game=214' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'U', link: '/buy/gameType/?game=215' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'U', link: '/buy/gameType/?game=216' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'U', link: '/buy/gameType/?game=217' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'U', link: '/buy/gameType/?game=218' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'U', link: '/buy/gameType/?game=219' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'V', link: '/buy/gameType/?game=221' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'V', link: '/buy/gameType/?game=222' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'V', link: '/buy/gameType/?game=223' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'V', link: '/buy/gameType/?game=224' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'V', link: '/buy/gameType/?game=225' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'V', link: '/buy/gameType/?game=226' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'V', link: '/buy/gameType/?game=227' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'V', link: '/buy/gameType/?game=228' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'V', link: '/buy/gameType/?game=229' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'W', link: '/buy/gameType/?game=231' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'W', link: '/buy/gameType/?game=232' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'W', link: '/buy/gameType/?game=233' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'W', link: '/buy/gameType/?game=234' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'W', link: '/buy/gameType/?game=235' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'W', link: '/buy/gameType/?game=236' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'W', link: '/buy/gameType/?game=237' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'W', link: '/buy/gameType/?game=238' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'W', link: '/buy/gameType/?game=239' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'X', link: '/buy/gameType/?game=241' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'X', link: '/buy/gameType/?game=242' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'X', link: '/buy/gameType/?game=243' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'X', link: '/buy/gameType/?game=244' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'X', link: '/buy/gameType/?game=245' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'X', link: '/buy/gameType/?game=246' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'X', link: '/buy/gameType/?game=247' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'X', link: '/buy/gameType/?game=248' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'X', link: '/buy/gameType/?game=249' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Y', link: '/buy/gameType/?game=251' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Y', link: '/buy/gameType/?game=252' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Y', link: '/buy/gameType/?game=253' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Y', link: '/buy/gameType/?game=254' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Y', link: '/buy/gameType/?game=255' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Y', link: '/buy/gameType/?game=256' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Y', link: '/buy/gameType/?game=257' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Y', link: '/buy/gameType/?game=258' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Y', link: '/buy/gameType/?game=259' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Z', link: '/buy/gameType/?game=261' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Z', link: '/buy/gameType/?game=262' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Z', link: '/buy/gameType/?game=263' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Z', link: '/buy/gameType/?game=264' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Z', link: '/buy/gameType/?game=265' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Z', link: '/buy/gameType/?game=266' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Z', link: '/buy/gameType/?game=267' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Z', link: '/buy/gameType/?game=268' },
        { name: '部落冲突', image: '/images/GamePicture.jpg', category: 'Z', link: '/buy/gameType/?game=269' },
        // 添加其他游戏数据
      ],
      // 顶部图片数组，每个图片包含src、alt和链接
      topImages: [
        { src: '/images/GamePicture.jpg', alt: 'Image 1', link: '/buy/gameType/?game=1' },
        { src: '/images/GamePicture.jpg', alt: 'Image 2', link: '/buy/gameType/?game=2' },
        { src: '/images/GamePicture.jpg', alt: 'Image 3', link: '/buy/gameType/?game=3' },
        { src: '/images/GamePicture.jpg', alt: 'Image 4', link: '/buy/gameType/?game=4' },
        { src: '/images/GamePicture.jpg', alt: 'Image 5', link: '/buy/gameType/?game=5' },
        { src: '/images/GamePicture.jpg', alt: 'Image 6', link: '/buy/gameType/?game=6' },
        { src: '/images/GamePicture.jpg', alt: 'Image 7', link: '/buy/gameType/?game=7' }
      ],
      // 初始导航栏顶部偏移量
      originalNavOffsetTop: 0
    }
  },
  computed: {
    // 根据字母分类游戏
    categorizedGames() {
      let categories = {}
      // 初始化每个字母的分类数组
      this.letters.slice(1).forEach(letter => {
        categories[letter] = []
      })
      // 将游戏数据按分类填充到相应字母数组中
      this.games.forEach(game => {
        if (categories[game.category]) {
          categories[game.category].push(game)
        }
      })
      return categories
    }
  },
  methods: {
    // 滚动到指定分类
    scrollToCategory(letter) {
      const element = document.getElementById(letter)
      if (element) {
        window.scrollTo({
          top: element.offsetTop - this.$refs.letterNav.offsetHeight,
          behavior: 'smooth'
        })
      }
    },
    // 处理滚动事件，固定导航栏
    handleScroll() {
      if (this.$refs.letterNav) {
        if (window.pageYOffset >= this.originalNavOffsetTop) {
          this.$refs.letterNav.classList.add('fixed')
        } else {
          this.$refs.letterNav.classList.remove('fixed')
        }
      }
    }
  },
  mounted() {
    // 在组件挂载后设置初始导航栏偏移量并添加滚动事件监听器
    this.$nextTick(() => {
      if (this.$refs.letterNav) {
        this.originalNavOffsetTop = this.$refs.letterNav.offsetTop
        window.addEventListener('scroll', this.handleScroll)
      }
    })
  },
  beforeDestroy() {
    // 组件销毁前移除滚动事件监听器
    window.removeEventListener('scroll', this.handleScroll)
  }
}

</script>

<style scoped>
/* 基本样式设置 */
body {
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
  margin: 0;
  padding: 0;
}

/* 容器样式 */
.container {
  width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 页头样式 */
.header h4 {
  color: #333;
  margin: 0;
  padding: 10px 0;
}

/* 字母导航栏样式 */
.letter-nav {
  width: 1140px; /* 设置字母导航栏的宽度为 1140 像素 */
  margin: 0 auto; /* 设置导航栏居中显示 */
  background-color: #fff; /* 背景颜色设置为白色 */
  padding: 10px; /* 内边距为 10 像素 */
  display: flex; /* 使用 flex 布局 */
  justify-content: flex-start; /* 内容水平居中 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影效果，水平偏移 0 像素，垂直偏移 2 像素，模糊半径 4 像素，颜色为黑色透明度 10% */
  border-bottom: 1px solid #ddd; /* 添加底部边框，颜色为浅灰色 #ddd，宽度 1 像素，实线 */
}


/* 固定字母导航栏样式，当字母导航栏滚动到页面顶部时固定位置 */
.letter-nav.fixed {
  position: fixed; /* 使元素固定在窗口的指定位置 */
  top: 0; /* 距离窗口顶部 0 像素 */
  left: 0; /* 距离窗口左侧 0 像素 */
  right: 0; /* 距离窗口右侧 0 像素 */
  z-index: 1000; /* 设置堆叠顺序，使其在其他元素之上 */
  margin-top: 70px;
}

/* 导航链接样式 */
.letter-nav a {
  text-decoration: none; /* 移除链接下划线 */
  color: #333; /* 设置链接文本颜色为深灰色 */
  font-weight: bold; /* 设置字体加粗 */
  margin: 0 10px; /* 设置左右外边距为 10 像素，顶部和底部为 0 像素 */
  cursor: pointer; /* 鼠标悬停时显示为指针样式 */
}

/* 导航链接悬停样式 */
.letter-nav a:hover {
  color: #007bff; /* 鼠标悬停时，链接文本颜色变为蓝色 */
}

/* 内容区样式 */
.content {
  background-color: #fff; /* 背景颜色为白色 */
  padding: 20px; /* 内边距为 20 像素 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影效果，水平偏移 0 像素，垂直偏移 2 像素，模糊半径 4 像素，颜色为黑色透明度 10% */
  border-radius: 8px; /* 边角半径为 8 像素，圆角效果 */
}

/* 游戏列表样式 */
.game-list {
  margin-top: 20px; /* 设置顶部外边距为 20 像素 */
}

/* 游戏分类样式 */
.game-category {
  display: flex; /* 使用 flex 布局 */
  align-items: flex-start; /* 子元素顶部对齐 */
  margin-bottom: 20px; /* 底部外边距为 20 像素 */
}




/* 游戏分类内部样式 */
.game-category .games {
  display: flex; /* 使用 flex 布局 */
  flex-wrap: wrap; /* 允许子元素换行 */
  gap: 10px; /* 子元素之间的间距为 10 像素 */
  flex-grow: 1; /* 使容器可以伸展 */
  background-color: #f9f9f9; /* 背景颜色为浅灰色 */
  padding: 10px; /* 内边距为 10 像素 */
  border-radius: 8px; /* 边角半径为 8 像素，圆角效果 */
  border: 1px solid #eee; /* 边框颜色为浅灰色 */
}


/* 单个游戏项样式 */
.game-category .games .game {
  width: 80px; /* 设置游戏项的宽度 */
  text-align: center; /* 文本居中 */
  transition: background-color 0.3s, border 0.3s; /* 添加背景颜色和边框的过渡效果 */
  padding: 10px; /* 添加内边距 */
  border-radius: 8px; /* 圆角效果 */
  border: 1px solid transparent; /* 初始边框为透明 */
}

/* 悬停时单个游戏项样式 */
.game-category .games .game:hover {
  background-color: #f0f8ff; /* 悬停时背景颜色变为浅蓝色 */
  border: 1px solid #007bff; /* 悬停时边框颜色变为蓝色 */
}

/* 游戏图片样式 */
.game-category .games .game img {
  width: 100%; /* 图片宽度100% */
  height: auto; /* 图片高度自适应 */
  border-radius: 8px; /* 圆角效果 */
  transition: box-shadow 0.3s, transform 0.3s; /* 添加过渡效果 */
}

/* 悬停时游戏图片样式 */
.game-category .games .game img:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 添加阴影效果 */
  transform: scale(1.05); /* 图片放大1.05倍 */
}

/* 字母列表样式 */
.game-category .letter {
  min-width: 40px; /* 最小宽度 */
  display: flex; /* 使用 flex 布局 */
  align-items: center; /* 垂直居中 */
  justify-content: center; /* 水平居中 */
  background-color: #ccc; /* 初始背景颜色为灰色 */
  color: black; /* 字体颜色为白色 */
  font-size: 16px; /* 字体大小 */
  font-weight: bold; /* 字体加粗 */
  border-radius: 4px; /* 圆角效果 */
  margin-right: 10px; /* 右外边距 */
  transition: background-color 0.3s; /* 添加背景颜色的过渡效果 */
}

/* 悬停时字母列表样式 */
.game-category:hover .letter {
  background-color: #007bff; /* 悬停时背景颜色变为蓝色 */
  color: white;
}

/* 游戏名称样式 */
.game-category .games .game p {
  margin: 5px 0 0; /* 设置段落的外边距，上方 5 像素，左右和下方 0 像素 */
  font-size: 12px; /* 设置字体大小为 12 像素 */
  color: #333; /* 设置字体颜色为深灰色 */
}

/* 顶部图片样式 */
.top-images {
  display: flex; /* 使用 flex 布局 */
  justify-content: space-between; /* 子元素之间均匀分布 */
  margin: 20px 0; /* 上下外边距为 20 像素，左右为 0 像素 */
}

/* 顶部图片链接样式 */
.top-images a {
  width: 120px; /* 设置链接宽度为 120 像素 */
}

/* 顶部图片样式 */
.top-images img {
  width: 100%; /* 图片宽度占据父元素的 100% */
  height: auto; /* 自动调整高度，保持宽高比 */
  border-radius: 8px; /* 边角半径为 8 像素，圆角效果 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影效果，水平偏移 0 像素，垂直偏移 2 像素，模糊半径 4 像素，颜色为黑色透明度 10% */
}

</style>
